From 3c2aceba63d80b3f10c7bb76896ccd9b32134a2d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 15 Aug 2018 23:13:15 +0000 Subject: [PATCH] print portal: Plug a memory leak Pointed out by Christian Persch. Closes https://gitlab.gnome.org/GNOME/gtk/issues/1271 --- gtk/gtkprintoperation-portal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkprintoperation-portal.c b/gtk/gtkprintoperation-portal.c index 43e6079be6..a6683fd212 100644 --- a/gtk/gtkprintoperation-portal.c +++ b/gtk/gtkprintoperation-portal.c @@ -378,7 +378,7 @@ prepare_print_response (GDBusConnection *connection, { PortalData *portal = data; guint32 response; - GVariant *options; + GVariant *options = NULL; if (portal->response_signal_id != 0) { @@ -427,6 +427,9 @@ prepare_print_response (GDBusConnection *connection, else portal->result = GTK_PRINT_OPERATION_RESULT_CANCEL; + if (options) + g_variant_unref (options); + if (portal->loop) g_main_loop_quit (portal->loop); } -- 2.30.2